Connecting to CockroachDB via CockroachDB Shell
Have you ever been fed up with the complicated procedures connecting to CockroachDB? In Cockroach Clusters, everything is simple and smooth. The following article will help you obtain the connection method easily.
1. Locate the target deployment
Log in to the Control Panel and locate your target deployment on the Home page or the My Applications page.
2.Create a Database and a User
If there is not any database or user, create the database and user first. Click the "Manage" button on the Home page or the My Applications page. Then Click the “DB & User” tab in the menu bar on the left. On the page, you can create your databases and users.
3. Get CockroachDB Shell connection string
Go to the "Overview" page to get the connection information.
4. Connect to CockroachDB server
Download and install CockroachDB community server program. Then follow either of the methods below, you can connect to the CockroachDB server successfully.
Option A: Copy the Shell connection string to the command window. Replace the <dbuser>
and <certs-dir>
with your own database user and the directory in which ca.crt files are stored. After that, input the password to connect to CockroachDB server.
Option B:Copy the Shell connection string to the command window. Replace the <dbuser>
,<dbpassword>
, and <ca-path>
with your own database user, password and the path to the ca.crt file. You are able to make the connection successfully then.